package datestructuresjava.danlianbiao;

//定义HeroNode 每个HeroNode对象就是一个节点
public class HeroNode {
    //英雄排名
    public int no;
    //英雄姓名
    public String name;
    //英雄绰号
    public String nickname;
    //指向下一个节点
    public HeroNode next;

    //初始化数据
    public HeroNode(int no, String name, String nickname) {
        this.no = no;
        this.name = name;
        this.nickname = nickname;
    }

    //展示英雄 重写toString方法
    @Override
    public String toString() {
        return "HeroNode [no ="+no+",name="+name+"nikename"+nickname+"]";
//        return "HeroNode{" +
//                "no=" + no +
//                ", name='" + name + '\'' +
//                ", nickname='" + nickname + '\'' +
//                ", next=" + next +
//                '}';
    }
}